#ifndef _JUDGE_FS_H
#define _JUDGE_FS_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>
#include "misc.h"

struct judge_fs_vtable {
	jstatus_t (__stdcall *open)(
		struct judge_fs *fs,
		/* out */ struct judge_file **file,
		const char *path);

	void (__stdcall *close)(
		struct judge_fs *fs,
		struct judge_file *file);
	
	jstatus_t (__stdcall *read)(
		struct judge_fs *fs,
		struct judge_file *file,
		char *buffer,
		uint32_t size,
		/* out */ uint32_t *actual_size);

	jstatus_t (__stdcall *find)(
		struct judge_fs *fs,
		/* out */ const char **path,
		const char *prefix,
		/* in out */ void **context);

};

struct judge_fs {
	struct judge_fs_vtable vtable;
};

#ifdef __cplusplus
}
#endif

#endif
